﻿using Domain.Entity;
using DtoFw;
using DtoFw.Enum;
using DtoFw.Query;
using Repository.Base;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;
using Util;

namespace Repository
{
    public class NotificationRepository : BaseRepository<NotificationEntity>
    {
        private readonly SnowFlakeGenerator worker;
        public NotificationRepository(SnowFlakeGenerator snowFlakeGenerator) : base(snowFlakeGenerator)
        {
            this.worker = snowFlakeGenerator;
        }

        /// <summary>
        /// 通知分页列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public Pager<NotificationEntity> GetPagerList(NotificationPagerReqDto query)
        {
            return base.GetPager(query, linq =>
            {
                if (query.Mold > 0)
                    linq = linq.Where(t => t.Mold == query.Mold);
                if (query.IsHandle > 0)
                    linq = linq.Where(t => t.IsHandle == query.IsHandle);
                if (!string.IsNullOrWhiteSpace(query.HandlePerson))
                    linq = linq.Where(t => t.HandlePerson.Contains(query.HandlePerson));
                if (query.NoticeTimeStart.HasValue && query.NoticeTimeEnd.HasValue)
                    linq = linq.Where(t => t.CreateTime >= query.NoticeTimeStart && t.CreateTime <= query.NoticeTimeEnd);
                return linq.Where(v => v.IsDeleted == false);
            }, null, x => x.CreateTime, OrderByType.Desc);
        }

        /// <summary>
        /// 获取：物品未绑定
        /// </summary>
        /// <param name="warnRequestDto">参数</param>
        /// <returns>信息</returns>
        public BaseGenericResult<Pager<WarnBindDto>> GetWarnEvidenceUnbound(WarnRequestDto dto)
        {
            int total = 1;
            Pager<WarnBindDto> pager = new Pager<WarnBindDto>();
            pager.Data = base.GetDb().Queryable<NotificationEntity, CasePhysicalEvidenceEntity, CaseEntity>((t1, t2, t3) => new JoinQueryInfos(
                    JoinType.Left, t1.CheckId == t2.Id , JoinType.Left, t2.CaseId == t3.Id))
                    .Where(t1 => t1.Mold == (int)EalyWarnTypeEnum.eNoBindWarning)
                    .Where((t1, t2, t3) => !t1.IsDeleted && !t2.IsDeleted && !t3.IsDeleted)
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.CaseNo), (t1, t2, t3) => t3.CaseNo.Contains(dto.CaseNo))
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.CaseName), (t1, t2, t3) => t3.CaseName.Contains(dto.CaseName))
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.InspectionNo), (t1, t2, t3) => t3.InspectionNo.Contains(dto.InspectionNo))
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.EvidenceNo), (t1, t2, t3) => t2.No.Contains(dto.EvidenceNo))
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.EvidenceName), (t1, t2, t3) => t2.Name.Contains(dto.EvidenceName))
                    .WhereIF(dto.IsHandle.HasValue, (t1, t2, t3) => t1.IsHandle == dto.IsHandle)
                    .OrderBy((t1, t2) => t1.CreateTime, OrderByType.Desc)
                    .Select((t1, t2, t3) => new WarnBindDto()
                    {
                        CaseNo = t3.CaseNo,
                        CaseName = t3.CaseName,
                        InspectionNo = t3.InspectionNo,
                        EvidenceNo = t2.No,
                        EvidenceName = t2.Name,
                        NoticeTime = t1.NoticeTime,
                        CaseId = t3.Id,
                        EvidenceId = t2.Id.ToString(),
                        IsResolved = t1.IsHandle,
                        RFID = t2.RFID,
                    }).ToPageList(dto.Page, dto.PageSize, ref total);
            pager.TotalCount = total;
            return BaseGenericResult<Pager<WarnBindDto>>.Succeed(pager);
        }

        /// <summary>
        /// 查询：未及时入库
        /// </summary>
        /// <param name="warnRequestDto">参数</param>
        /// <returns>信息</returns>
        public BaseGenericResult<Pager<WarnBindDto>> GetWarnOvertimeStock(WarnRequestDto dto)
        {
            int total = 1;
            Pager<WarnBindDto> pager = new Pager<WarnBindDto>();
            pager.Data = base.GetDb().Queryable<NotificationEntity, CasePhysicalEvidenceEntity, CaseEntity>((t1, t2, t3) => new JoinQueryInfos(
                    JoinType.Inner, t1.CheckId == t2.Id, JoinType.Inner, t2.CaseId == t3.Id))
                    .Where(t1 => t1.Mold == (int)EalyWarnTypeEnum.eOvertimeStockWarning)
                      .Where((t1, t2, t3) => !t1.IsDeleted && !t2.IsDeleted && !t3.IsDeleted)
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.CaseNo), (t1, t2, t3) => t3.CaseNo.Contains(dto.CaseNo))
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.EvidenceNo), (t1, t2, t3) => t2.No.Contains(dto.EvidenceNo))
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.EvidenceName), (t1, t2, t3) => t2.Name.Contains(dto.EvidenceName))
                    .WhereIF(dto.IsHandle.HasValue, (t1, t2, t3) => t1.IsHandle == dto.IsHandle.Value)
                    .OrderBy((t1, t2) => t1.CreateTime, OrderByType.Desc)
                    .Select((t1, t2, t3) => new WarnBindDto()
                    {
                        CaseNo = t3.CaseNo,
                        CaseName = t3.CaseName,
                        EvidenceNo = t2.No,
                        EvidenceName = t2.Name,
                        NoticeTime = t1.NoticeTime,
                        RegisterTime = t1.CheckTime,
                        InspectionNo = t3.InspectionNo,
                        CaseId = t3.Id,
                        EvidenceId = t2.Id.ToString(),
                        IsResolved = t1.IsHandle,
                        RFID = t2.RFID,
                        Status = t2.Status,
                        CreateTime = t2.CreateTime,

                    }).ToPageList(dto.Page, dto.PageSize, ref total);
            pager.TotalCount = total;
            return BaseGenericResult<Pager<WarnBindDto>>.Succeed(pager);
        }

        /// <summary>
        /// 查询：未及时回库
        /// </summary>
        /// <param name="warnRequestDto">参数</param>
        /// <returns>信息</returns>
        public BaseGenericResult<Pager<WarnBindDto>> GetWarnOvertimeRevert(WarnRequestDto dto)
        {
            int total = 1;
            Pager<WarnBindDto> pager = new Pager<WarnBindDto>();
            pager.Data = base.GetDb().Queryable<NotificationEntity, CasePhysicalEvidenceEntity, CaseEntity>((t1, t2, t3) => new JoinQueryInfos(
                    JoinType.Left, t1.CheckId == t2.Id, JoinType.Left, t2.CaseId == t3.Id))
                    .Where(t1 => t1.Mold == (int)EalyWarnTypeEnum.eOvertimeRevertWarning)
                      .Where((t1, t2, t3) => !t1.IsDeleted && !t2.IsDeleted && !t3.IsDeleted)
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.CaseNo), (t1, t2, t3) => t3.CaseNo.Contains(dto.CaseNo))
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.EvidenceNo), (t1, t2, t3) => t2.No.Contains(dto.EvidenceNo))
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.EvidenceName), (t1, t2, t3) => t2.Name.Contains(dto.EvidenceName))
                    .WhereIF(dto.IsHandle.HasValue, (t1, t2, t3) => t1.IsHandle == dto.IsHandle.Value)
                    .OrderBy((t1, t2) => t1.CreateTime, OrderByType.Desc)
                    .Select((t1, t2, t3) => new WarnBindDto()
                    {
                        CaseNo = t3.CaseNo,
                        CaseName = t3.CaseName,
                        EvidenceNo = t2.No,
                        EvidenceName = t2.Name,
                        NoticeTime = t1.NoticeTime,
                        ReturnTime = t1.CheckTime,
                        InspectionNo = t3.InspectionNo,
                        CaseId = t3.Id,
                        EvidenceId = t2.Id.ToString(),
                        IsResolved = t1.IsHandle,
                        RFID = t2.RFID,
                        CreateTime = t2.UsefulLife

                    }).ToPageList(dto.Page, dto.PageSize, ref total);
            pager.TotalCount = total;
            return BaseGenericResult<Pager<WarnBindDto>>.Succeed(pager);
        }

        /// <summary>
        /// 查询：出库异常
        /// </summary>
        /// <param name="warnRequestDto">参数</param>
        /// <returns>信息</returns>
        public BaseGenericResult<Pager<WarnBindDto>> GetWarnEvidenceStock(WarnRequestDto dto)
        {
            int total = 1;
            Pager<WarnBindDto> pager = new Pager<WarnBindDto>();
            pager.Data = base.GetDb().Queryable<NotificationEntity, CasePhysicalEvidenceEntity, CaseEntity>((t1, t2, t3) => new JoinQueryInfos(
                    JoinType.Left, t1.CheckId == t2.Id, JoinType.Left, t2.CaseId == t3.Id))
                    .Where((t1, t2, t3) => !t1.IsDeleted&& !t2.IsDeleted && !t3.IsDeleted)
                    .Where(t1 => t1.Mold == (int)EalyWarnTypeEnum.eUnusualLevelWarning)
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.CaseNo), (t1, t2, t3) => t3.CaseNo.Contains(dto.CaseNo))
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.CaseName), (t1, t2, t3) => t3.CaseName.Contains(dto.CaseName))
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.InspectionNo), (t1, t2, t3) => t3.InspectionNo.Contains(dto.InspectionNo))
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.EvidenceNo), (t1, t2, t3) => t2.No.Contains(dto.EvidenceNo))
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.EvidenceName), (t1, t2, t3) => t2.Name.Contains(dto.EvidenceName))
                    .WhereIF(dto.IsHandle.HasValue, (t1, t2, t3) => t1.IsHandle == dto.IsHandle)
                    .OrderBy((t1, t2) => t1.CreateTime, OrderByType.Desc)
                    .Select((t1, t2, t3) => new WarnBindDto()
                    {
                        CaseNo = t3.CaseNo,
                        CaseName = t3.CaseName,
                        InspectionNo = t3.InspectionNo,
                        EvidenceNo = t2.No,
                        EvidenceName = t2.Name,
                        NoticeTime = t1.NoticeTime,
                        Status = t2.Status,
                        CaseId = t3.Id,
                        //CreateTime = DateTime.Now,
                        EvidenceId = t2.Id.ToString(),
                        IsResolved = t1.IsHandle,
                        RFID = t2.RFID,

                    }).ToPageList(dto.Page, dto.PageSize, ref total);
            pager.TotalCount = total;
            return BaseGenericResult<Pager<WarnBindDto>>.Succeed(pager);
        }

        /// <summary>
        /// 查询：环境异常
        /// </summary>
        /// <param name="warnRequestDto">参数</param>
        /// <returns>信息</returns>
        public BaseGenericResult<Pager<WarnEnvironmentDto>> GetWarnEnvironment(WarnEnvironmentRequestDto dto)
        {
            int total = 1;
            Pager<WarnEnvironmentDto> pager = new Pager<WarnEnvironmentDto>();
            pager.Data = base.GetDb().Queryable<NotificationEntity, WarnEnvironmentEntity>((t1, t2) => new JoinQueryInfos(
                    JoinType.Left, t1.CheckId == t2.Id))
                    .Where((t1, t2) => !t1.IsDeleted && !t2.IsDeleted )
                    // .Where(t1 => t1.IsHandle == 1)
                    .WhereIF(dto.EnvironmentType.HasValue, (t1, t2) => t1.Mold == dto.EnvironmentType.Value)
                    .WhereIF(!dto.EnvironmentType.HasValue || dto.EnvironmentType == -1, (t1, t2) => t1.Mold == 5 || t1.Mold == 6 || t1.Mold == 7 || t1.Mold == 8 || t1.Mold == 9)
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.AreaName), (t1, t2) => t2.Area.Contains(dto.AreaName))
                     .OrderBy((t1, t2) => t1.CreateTime, OrderByType.Desc)
                    .Select((t1, t2) => new WarnEnvironmentDto()
                    {
                        AreaName = t2.Area,
                        EnvironmentType = t2.Mold,
                        ValInfo = t2.ValInfo,
                        Source = t2.Source,
                        NoticeTime = t1.NoticeTime,

                    }).ToPageList(dto.Page, dto.PageSize, ref total);

            /*var list = base.GetDb().Queryable<NotificationEntity>()
                .Where(t1 => t1.Mold == (int)EalyWarnTypeEnum.eTemperatureWarning || t1.Mold == (int)EalyWarnTypeEnum.eHumidityWarning || t1.Mold == (int)EalyWarnTypeEnum.eSmokeWarning || t1.Mold == (int)EalyWarnTypeEnum.eWaterWarning || t1.Mold == (int)EalyWarnTypeEnum.eAirWarning)
                    .WhereIF(dto.EnvironmentType.HasValue, t1 => t1.Mold == dto.EnvironmentType.Value)
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.AreaName), t1 => t1.OrganName.Contains(dto.AreaName))
                    .Select(t1 => new WarnEnvironmentDto()
                    {
                        AreaName = t1.OrganName,
                        EnvironmentType = t1.Mold,
                        //ValInfo = t1.ValInfo,
                        //Source = t1.Source,
                        NoticeTime = t1.NoticeTime,

                    }).ToList();
            */
            pager.TotalCount = total;
            return BaseGenericResult<Pager<WarnEnvironmentDto>>.Succeed(pager);
        }

        /// <summary>
        /// 查询：保存超期
        /// </summary>
        /// <param name="warnRequestDto">参数</param>
        /// <returns>信息</returns>
        public BaseGenericResult<Pager<WarnBindDto>> GetWarnOvertimeSave(WarnRequestDto dto)
        {
            int total = 1;
            Pager<WarnBindDto> pager = new Pager<WarnBindDto>();
            pager.Data = base.GetDb().Queryable<NotificationEntity, CasePhysicalEvidenceEntity, CaseEntity>((t1, t2, t3) => new JoinQueryInfos(
                    JoinType.Left, t1.CheckId == t2.Id, JoinType.Left, t2.CaseId == t3.Id))
                    .Where(t1 => t1.Mold == (int)EalyWarnTypeEnum.OvertimeSaveWarning)
                         .Where((t1, t2, t3) => !t1.IsDeleted && !t2.IsDeleted && !t3.IsDeleted)
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.CaseNo), (t1, t2, t3) => t3.CaseNo.Contains(dto.CaseNo))
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.EvidenceNo), (t1, t2, t3) => t2.No.Contains(dto.EvidenceNo))
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.EvidenceName), (t1, t2, t3) => t2.Name.Contains(dto.EvidenceName))
                    .OrderBy((t1, t2) => t1.CreateTime, OrderByType.Desc)
                    .Select((t1, t2, t3) => new WarnBindDto()
                    {
                        CaseNo = t3.CaseNo,
                        CaseName = t3.CaseName,
                        InspectionNo = t3.InspectionNo,
                        EvidenceNo = t2.No,
                        EvidenceName = t2.Name,
                        NoticeTime = t1.NoticeTime,
                        SaveOvertime = t1.CheckTime,
                        Status = t2.Status,
                        CaseId = t3.Id,
                        //CreateTime = DateTime.Now,
                        EvidenceId = t2.Id.ToString(),
                        IsResolved = t1.IsHandle,
                        RFID = t2.RFID,

                    }).ToPageList(dto.Page, dto.PageSize, ref total);
            pager.TotalCount = total;
            return BaseGenericResult<Pager<WarnBindDto>>.Succeed(pager);
        }

        /// <summary>
        /// 查询：库容爆仓
        /// </summary>
        /// <param name="warnRequestDto">参数</param>
        /// <returns>信息</returns>
        public BaseGenericResult<Pager<WarnStockQuantityDto>> GetWarnStockQuantity(WarnStockQuantityRequestDto dto, StockQuantityWarning stockQuantityWarning)
        {
            int total = 1;
            Pager<WarnStockQuantityDto> pager = new Pager<WarnStockQuantityDto>();
            pager.Data = base.GetDb().Queryable<NotificationEntity, RoomBoxEntity, RoomCabinetEntity, RoomAreaEntity>((t1, t2, t3, t4) => new JoinQueryInfos(
                    JoinType.Left, t1.CheckId == t2.Id, JoinType.Left, t2.CabinetId == t3.Id, JoinType.Left, t3.AreaId == t4.Id))
                     .Where((t1, t2, t3,t4) => !t1.IsDeleted && !t2.IsDeleted && !t3.IsDeleted && !t4.IsDeleted)
                    .Where(t1 => t1.Mold == (int)EalyWarnTypeEnum.eStockQuantityWarning)
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.AreaName), (t1, t2, t3, t4) => t4.Name.Contains(dto.AreaName))
                    .WhereIF(!string.IsNullOrWhiteSpace(dto.CabinetName), (t1, t2, t3, t4) => t3.CabinetName.Contains(dto.CabinetName))
                    .OrderBy((t1, t2) => t1.CreateTime, OrderByType.Desc)
                    .Select((t1, t2, t3, t4) => new WarnStockQuantityDto()
                    {
                        AreaName = t3.Name,
                        CabinetName = t3.CabinetName,
                        BoxName = t2.Name,
                        EviCount = t2.EviCount,
                        Total = t2.Total,
                        NoticeTime = t1.NoticeTime,
                        LessVolume = stockQuantityWarning.LessVolume,
                        GreaterOrEqualVolume = stockQuantityWarning.GreaterOrEqualVolume,
                    }).ToPageList(dto.Page, dto.PageSize, ref total);
            pager.TotalCount = total;
            return BaseGenericResult<Pager<WarnStockQuantityDto>>.Succeed(pager);
        }

        /// <summary>
        /// 查询：根据箱子ID获取：区域名称、柜子名称、箱子名称
        /// </summary>
        /// <param name="warnRequestDto">参数</param>
        /// <returns>信息</returns>
        public Tuple<string, string, string> GetBoxInfo(long id)
        {
            var entity = base.GetDb().Queryable<RoomBoxEntity, RoomAreaEntity, RoomCabinetEntity>((t2, t3, t4) => new JoinQueryInfos(
                    JoinType.Left, t2.AreaId == t3.Id, JoinType.Left, t3.Id == t4.AreaId))
                    .Where(t2 => t2.Id == id).Select((t2, t3, t4) => new WarnStockQuantityDto
                    {
                        AreaName = t3.Name,
                        CabinetName = t4.CabinetName,
                        BoxName = t2.Name,
                    }).First();
            return new Tuple<string, string, string>(entity.AreaName, entity.CabinetName, entity.BoxName);
        }

        #region 处理：预警信息

        /// <summary>
        /// 处理：物证相关预警
        /// </summary>
        /// <param name="casePhysicalEvidenceIdList">物证ID</param>
        /// <param name="handlePerson">处理人</param>
        /// <returns>是否成功</returns>
        public bool HandleWarnCases(List<long> caseIdList, string handlePerson)
        {
            if (caseIdList == null || caseIdList.Count < 1) return false;
            var casePhysicalEvidenceIdList = base.GetDb().Queryable<CasePhysicalEvidenceEntity>().Where(x => !x.IsDeleted && caseIdList.Contains(x.CaseId)).Select(y => y.Id).ToList();

            if (casePhysicalEvidenceIdList == null || casePhysicalEvidenceIdList.Count < 1) return false;
            var notificationList = base.GetDb().Queryable<NotificationEntity>().Where(x => !x.IsDeleted && x.CheckId.HasValue && casePhysicalEvidenceIdList.Contains(x.CheckId.Value)).ToList();

            notificationList.ForEach(x =>
            {
                x.IsHandle = 0;
                x.HandlePerson = handlePerson;
                x.HandleTime = DateTime.Now;
            });

            if (base.GetDb().Updateable<CasePhysicalEvidenceEntity>(notificationList).ExecuteCommand() > 0) return true;

            return false;
        }

        /// <summary>
        /// 处理：物证相关预警
        /// </summary>
        /// <param name="casePhysicalEvidenceIdList">物证ID</param>
        /// <param name="ealyWarnTypeEnum">预警消息类型</param>
        /// <param name="handlePerson">处理人</param>
        /// <returns>是否成功</returns>
        public bool HandleWarnCasePhysicalEvidences(List<long> casePhysicalEvidenceIdList, string handlePerson)
        {
            if (casePhysicalEvidenceIdList == null || casePhysicalEvidenceIdList.Count < 1) return false;
            var notificationList = base.GetDb().Queryable<NotificationEntity>()
                .Where(x => x.IsDeleted == false && x.CheckId.HasValue && x.Mold != (int)EalyWarnTypeEnum.eNoBindWarning && casePhysicalEvidenceIdList.Contains(x.CheckId.Value)).ToList();

            notificationList.ForEach(x =>
            {
                x.IsHandle = 0;
                x.HandlePerson = handlePerson;
                x.HandleTime = DateTime.Now;
            });

            if (notificationList.Count == 0)
                return true;

            if (base.GetDb().Updateable<NotificationEntity>(notificationList).ExecuteCommand() > 0) return true;

            return false;
        }

        /// <summary>
        /// 处理：物证相关预警
        /// </summary>
        /// <param name="casePhysicalEvidenceIdList">物证ID</param>
        /// <param name="ealyWarnTypeEnum">预警消息类型</param>
        /// <param name="handlePerson">处理人</param>
        /// <returns>是否成功</returns>
        public bool HandleWarnCasePhysicalEvidences(List<long> casePhysicalEvidenceIdList, EalyWarnTypeEnum wenum, string handlePerson)
        {
            if (casePhysicalEvidenceIdList == null || casePhysicalEvidenceIdList.Count < 1) return false;
            var notificationList = base.GetDb().Queryable<NotificationEntity>()
                .Where(x => !x.IsDeleted && x.Mold == (int)wenum && x.CheckId.HasValue && casePhysicalEvidenceIdList.Contains(x.CheckId.Value)).ToList();

            notificationList.ForEach(x =>
            {
                x.IsHandle = 0;
                x.HandlePerson = handlePerson;
                x.HandleTime = DateTime.Now;
            });

            if (base.GetDb().Updateable<CasePhysicalEvidenceEntity>(notificationList).ExecuteCommand() > 0) return true;

            return false;
        }

        /// <summary>
        /// 处理：物品未绑定
        /// </summary>
        /// <param name="casePhysicalEvidenceIdList">物证ID</param>
        /// <returns>是否成功</returns>
        public bool HandleWarnEvidenceUnbound(List<long> casePhysicalEvidenceIdList, string handlePerson)
        {
            return HandleWarnCasePhysicalEvidences(casePhysicalEvidenceIdList, EalyWarnTypeEnum.eNoBindWarning, handlePerson);
        }

        /// <summary>
        /// 处理：未及时入库
        /// </summary>
        /// <param name="casePhysicalEvidenceIdList">物证ID</param>
        /// <returns>是否成功</returns>
        public bool HandleWarnOvertimeStock(List<long> casePhysicalEvidenceIdList, string handlePerson)
        {
            return HandleWarnCasePhysicalEvidences(casePhysicalEvidenceIdList, handlePerson);
        }

        /// <summary>
        /// 处理：未及时回库
        /// </summary>
        /// <param name="casePhysicalEvidenceIdList">物证ID</param>
        /// <returns>是否成功</returns>
        public bool HandleWarnOvertimeRevert(List<long> casePhysicalEvidenceIdList, string handlePerson)
        {
            return HandleWarnCasePhysicalEvidences(casePhysicalEvidenceIdList, handlePerson);
        }

        /// <summary>
        /// 处理：出库异常
        /// </summary>
        /// <param name="casePhysicalEvidenceIdList">物证ID</param>
        /// <returns>是否成功</returns>
        public bool HandleWarnEvidenceStock(List<long> casePhysicalEvidenceIdList, string handlePerson)
        {
            return HandleWarnCasePhysicalEvidences(casePhysicalEvidenceIdList, handlePerson);
        }

        /// <summary>
        /// 处理：保存超期
        /// </summary>
        /// <param name="casePhysicalEvidenceIdList">物证ID</param>
        /// <returns>是否成功</returns>
        public bool HandleWarnOvertimeSave(List<long> casePhysicalEvidenceIdList, string handlePerson)
        {
            return HandleWarnCasePhysicalEvidences(casePhysicalEvidenceIdList, handlePerson);
        }

        #endregion
    }
}
